.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" License.
.\" Modified Sat Jul 24 19:00:59 1993 by Rik Faith (faith@cs.unc.edu)
.\" Clarification concerning realloc, iwj10@cus.cam.ac.uk (Ian Jackson), 950701
.\" Modified Sat Jun 13 20:15:59 1998 by Jeff Thompson (Jeffrey W. Thompson)
.\" Removed realloc call as it does not yet exist.
.\"
.TH CALLOC 3  "June 13, 1998" "GuildOS" "GuildOS Programmer's Manual"
.SH NAME
calloc, malloc, free \- Allocate and free dynamic memory
.SH SYNOPSIS
.nf
.B #include <stdlib.h>
.sp
.BI "void *calloc(size_t " "nmemb" ", size_t " "size" ");"
.nl
.BI "void *malloc(size_t " "size" ");"
.nl
.BI "void free(void " "*ptr" ");"
.fi
.SH DESCRIPTION
.B calloc()
allocates memory for an array of 
.I nmemb
elements of 
.I size
bytes each and returns a pointer to the allocated memory. 
The memory is set to zero.
.PP
.B malloc()
allocates
.I size
bytes and returns a pointer to the allocated memory. 
The memory is not cleared.
.PP
.B free()
frees the memory space pointed to by
.IR ptr ,
which must have been returned by a previous call to
.BR malloc() ,
.B calloc()
If
.I ptr
is
.BR NULL ,
no operation is performed.
.PP
.SH "RETURN VALUES"
For
.BR calloc() " and " malloc() ,
the value returned is a pointer to the allocated memory, which is suitably
aligned for any kind of variable, or
.B NULL
if the request fails.
.PP
.B free()
returns no value.
.PP
.SH "CONFORMS TO"
ANSI - C
.SH "SEE ALSO"
.BR brk (2)
